<html><head><title>Entering a Number with Leading Zeros</title><meta name="filename" content="text/scalc/guide/integer_leading_zero"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
p.P1{
}
p.P2{
}
p.P3{
}
span.T1{
font-weight:bold;}
</style></head><body>
<p class="P1"/>
<p class="Head1"><help:key-word value="zeros; entering" tag="kw68083_2" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="number; with leading zero" tag="kw68083_12" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="leading zeros; entering/suppressing" tag="kw68083_11" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="whole number; with leading zeros" tag="kw68083_10" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="integer_leading_zero" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68083">Entering a Number with Leading Zeros</help:link></help:to-be-embedded></p>
<p class="Paragraph"><help:key-word value="Zero, entering a" tag="kw68083_9"/><help:key-word value="Numbers starting with a zero" tag="kw68083_8"/>There are various ways to enter <help:key-word value="integers starting with a zero" tag="kw68083_1"/>integers starting with a zero:<help:key-word value="leading zeros" tag="kw68083_7"/></p>
<ul class="L1">
<li class="">
<p style="">Enter the number as text. The easiest way is to enter the number starting with an apostrophe (for example, '0987). The apostrophe will not be entered in the cell and the number will be formatted as text. Because it is in text format, however, you won't be able to calculate with this number.</p>
</li>
<li class="">
<p style="">Format a cell with a number format such as \0000. This format can be assigned in the <span style="font-weight:bold;">Format code</span> box under <span style="font-weight:bold;">Format - Cells... - Numbers</span> tab and defines the cell display as "always put a zero first and then the integer, having at least three places, and filled with zeros at the left if less than three digits".</p>
<p class="Paragraph">If, however, you have imported an entire column with numbers in "text format", i.e. in the form of "000123", which you now want to turn into "real" numbers again without zeros in front of them, i.e. in the form of "123", proceed as follows:</p>
<ol class="L2">
<li class="">
<p style="">Select the column in which the digits are found in "text format". Set the cell format in that column as "Number".</p>
</li>
<li class="">
<p style="">Call up <span style="font-weight:bold;">Edit - Find & Replace</span></p>
</li>
<li class="">
<p style="">In the <span style="font-weight:bold;">Search for</span> box, enter ^[0-9]</p>
</li>
<li class="">
<p style="">In the <span style="font-weight:bold;">Replace with</span> box enter: &</p>
</li>
<li class="">
<p style="">Put a check in front of <span style="font-weight:bold;">Regular expressions</span></p>
</li>
<li class="">
<p style="">Put a check in front of <span style="font-weight:bold;">Current selection only</span></p>